package com.itbupt.dao;

import com.itbupt.domain.po.PayOrder;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Author dingchang
 * @Date 2025/5/8 11:41
 * @Description:
 */

@Mapper
public interface IOrderDao {

    // 查询未支付订单
    PayOrder queryUnPayOrder(PayOrder payOrderReq);

    // 插入一条订单记录 - 状态为 create
    void insert(PayOrder build);

    // 更新订单状态 state为 PAY_WAIT-等待支付
    void updateOrderPayInfo(PayOrder payOrder);

    // 查询未支付的订单id
    List<String> queryNoPayNotifyOrder();

    // 更新订单状态 state为 PAY_SUCCESS-支付成功
    void changeOrderPaySuccess(PayOrder payOrderReq);

    // 查询超时未支付订单
    List<String> queryTimeoutCloseOrderList();

    // 更新订单状态 state为 CLOSE-关闭
    boolean changeOrderClose(String orderId);

}
